Skip to content

feat(tools): add Xiaomi MiMo (mimocode) tool support - #2301

Open
fujufutong wants to merge 1 commit into
Tencent:mainfrom
fujufutong:feat/mimocode-support
Open

fujufutong wants to merge 1 commit into
Tencent:mainfrom
fujufutong:feat/mimocode-support

Conversation

@fujufutong

Copy link
Copy Markdown

Summary

Add built-in tool support for Xiaomi MiMo (mimocode, package @teamai/tool-mimocode), syncing skills and subagent definitions in both user scope (~/.config/mimocode/{skills,agents}, relocating with $MIMOCODE_HOME/config and $XDG_CONFIG_HOME/mimocode) and project scope (<root>/.mimocode/{skills,agents}). Subagents render and reverse as path-named Markdown files (with effort mapped to variant and dotted agent stems preserved, as MiMoCode strips only .md), while unsupported channels (rules, blocks, mcp, hooks, sessions, launch, tokens) are explicitly declared as NONE / 'none'.

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature causing existing behavior to change)
  • Documentation only
  • Refactor / internal cleanup

Test Plan

  • npx tsc --noEmit passes (npm run typecheck)
  • npm run lint passes (oxlint --type-aware --deny-warnings --report-unused-disable-directives && node scripts/check-docs.mjs)
  • The test files that cover what I changed pass (npx vitest run packages/tool-mimocode oxlint-plugin-teamai/rules/family-facts.test.ts oxlint-plugin-teamai/rules/tool-home-env.test.ts oxlint-plugin-teamai/rules/shipped-tool-ids.test.ts src/__tests__/tools.test.ts src/__tests__/tools-channels.test.ts src/__tests__/tool-home-env-variables.test.ts src/__tests__/locate.test.ts src/__tests__/locate-matrix.test.ts src/__tests__/locate-agents.test.ts src/__tests__/locate-mcp.test.ts src/__tests__/agent-format.test.ts src/__tests__/self-mode-agents.test.ts src/__tests__/self-mode-prompt.test.ts src/__tests__/uninstall.test.ts — 15 files, 2,803 tests passed; full suite and extra providers/OS legs deferred to CI)
  • Added/updated tests for the change
  • Runtime change: verified end to end with the built CLI (dist/index.js at 7e080be4, teamai-cli@0.22.0) in isolated temp sandboxes across both project and relocated user (MIMOCODE_HOME) scopes. (npm run verify:world could not pack on this host because local npm 12.0.2 emits an object map { "teamai-cli": { files } } from npm pack --dry-run --json where scripts/verify/world.ts expects an array.)
VERIFIED: mimocode x git x project & user (MIMOCODE_HOME) scopes via built CLI (dist/index.js, commit 7e080be4, teamai 0.22.0)
$ node dist/index.js init https://git.example.com/team/mimo.git --scope project --agent mimocode --force
$ node dist/index.js pull   # 1st and 2nd runs -> delivered .mimocode/skills/release-notes/SKILL.md and .mimocode/agents/backend.agent.md (mode: subagent, variant: high)
$ node dist/index.js uninstall --agent mimocode --force   # removed delivered skills and agents cleanly
$ MIMOCODE_HOME=<tmp>/custom-mimo node dist/index.js init https://git.example.com/team/mimo.git --scope user --agent mimocode --force
$ MIMOCODE_HOME=<tmp>/custom-mimo node dist/index.js pull   # 1st and 2nd runs -> delivered <MIMOCODE_HOME>/config/{skills,agents}
$ MIMOCODE_HOME=<tmp>/custom-mimo node dist/index.js uninstall --agent mimocode --force   # removed delivered skills and agents cleanly

Related Issues

N/A

Notes for Reviewers

  • Home resolution (absolute-env-child): MiMoCode resolves its config directory from $MIMOCODE_HOME/config (only when $MIMOCODE_HOME is an absolute path), falling back to $XDG_CONFIG_HOME/mimocode and ~/.config/mimocode. Added the absolute-env-child HomeMove variant to model this at the descriptor boundary without per-tool branching in shared locate code.
  • Agent filename stems: Unlike Copilot's .agent.md suffix, MiMoCode derives agent IDs by stripping .md only (so backend.agent.md names backend.agent). agentStemFromFilename takes the optional tool format so agents delivery and uninstall preserve dotted MiMoCode agent names.
  • Surfaces checked:
    • Tools: Adds mimocode; existing tool descriptors and channels unchanged.
    • Where a step runs: launch: 'none' (skill driver workflows reach MiMoCode via delivered skills; local/sandbox step launchers do not spawn MiMoCode).
    • Scopes: Both user (~/.config/mimocode, $MIMOCODE_HOME/config, $XDG_CONFIG_HOME/mimocode) and workspace (<root>/.mimocode, gated on installedBy: 'home-edition').
    • Team repo modes: git, http, and self mode (SELF_MODE_AGENT_CHOICES and detectHomeInstalledAgents updated for home-edition).
    • Checkouts / Layers: Uses standard locate workspaceUnder project reads and standard SkillsHandler / AgentsHandler layer resolution.
    • Entry points & Reverse states: init, pull (first and second runs), and uninstall all locate and clean up delivered skills and dotted/plain subagent .md files.
    • OS: Path handling uses host.path (absoluteEnv + host.path.join); Windows CI leg deferred to GitHub Actions (verified on macOS locally).
    • Docs & skill-data/: Regenerated docs/guide/tool-support.md and docs/guide/zh-CN/tool-support.md, and updated all README*.md capability matrices.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant